package android.support.v4.view;

import android.content.Context;
import android.content.res.Resources;
import android.graphics.Canvas;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.os.Build.VERSION;
import android.os.Parcelable;
import android.support.v4.d.a;
import android.util.AttributeSet;
import android.util.DisplayMetrics;
import android.view.FocusFinder;
import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.SoundEffectConstants;
import android.view.VelocityTracker;
import android.view.View;
import android.view.View.MeasureSpec;
import android.view.ViewConfiguration;
import android.view.ViewGroup;
import android.view.ViewGroup.LayoutParams;
import android.view.ViewParent;
import android.view.accessibility.AccessibilityEvent;
import android.view.animation.Interpolator;
import android.widget.Scroller;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;

public class ViewPager extends ViewGroup
{
  private static final int[] a = { 16842931 };
  private static final bd ad;
  private static final Comparator b = new as();
  private static final Interpolator c = new at();
  private boolean A;
  private int B;
  private int C;
  private int D;
  private float E;
  private float F;
  private float G;
  private float H;
  private int I = -1;
  private VelocityTracker J;
  private int K;
  private int L;
  private int M;
  private int N;
  private boolean O;
  private a P;
  private a Q;
  private boolean R = true;
  private boolean S = false;
  private boolean T;
  private int U;
  private az V;
  private az W;
  private ay Z;
  private ba aa;
  private int ab;
  private ArrayList ac;
  private final Runnable ae = new au(???);
  private int af = 0;
  private final ArrayList d = new ArrayList();
  private final aw e = new aw();
  private final Rect f = new Rect();
  private v g;
  private int h;
  private int i = -1;
  private Parcelable j = null;
  private ClassLoader k = null;
  private Scroller l;
  private bb m;
  private int n;
  private Drawable o;
  private int p;
  private int q;
  private float r = -3.402824E+038F;
  private float s = 3.4028235E+38F;
  private int t;
  private int u;
  private boolean v;
  private boolean w;
  private boolean x;
  private int y = 1;
  private boolean z;

  static
  {
    ad = new bd();
  }

  public ViewPager(Context paramContext)
  {
    super(paramContext);
    f();
  }

  public ViewPager(Context paramContext, AttributeSet paramAttributeSet)
  {
    super(paramContext, paramAttributeSet);
    f();
  }

  private Rect a(Rect paramRect, View paramView)
  {
    if (paramRect == null)
      paramRect = new Rect();
    while (true)
    {
      if (paramView == null)
      {
        paramRect.set(0, 0, 0, 0);
        return paramRect;
      }
      paramRect.left = paramView.getLeft();
      paramRect.right = paramView.getRight();
      paramRect.top = paramView.getTop();
      paramRect.bottom = paramView.getBottom();
      for (paramView = paramView.getParent(); (paramView instanceof ViewGroup) && (paramView != this); paramView = paramView.getParent())
      {
        paramView = (ViewGroup)paramView;
        paramRect.left += paramView.getLeft();
        paramRect.right += paramView.getRight();
        paramRect.top += paramView.getTop();
        paramRect.bottom += paramView.getBottom();
      }
      return paramRect;
    }
  }

  private aw a(int paramInt1, int paramInt2)
  {
    aw localaw = new aw();
    localaw.b = paramInt1;
    localaw.a = this.g.a(this, paramInt1);
    localaw.d = 1.0F;
    if ((paramInt2 < 0) || (paramInt2 >= this.d.size()))
    {
      this.d.add(localaw);
      return localaw;
    }
    this.d.add(paramInt2, localaw);
    return localaw;
  }

  private aw a(View paramView)
  {
    int i1 = 0;
    while (i1 < this.d.size())
    {
      aw localaw = (aw)this.d.get(i1);
      if (this.g.a(paramView, localaw.a))
        return localaw;
      i1 += 1;
    }
    return null;
  }

  private void a(int paramInt, float paramFloat)
  {
    int i1;
    int i2;
    int i3;
    int i4;
    int i5;
    int i7;
    int i9;
    View localView;
    if (this.U > 0)
    {
      int i6 = getScrollX();
      i1 = getPaddingLeft();
      i2 = getPaddingRight();
      i7 = getWidth();
      int i8 = getChildCount();
      i5 = 0;
      if (i5 < i8)
      {
        localView = getChildAt(i5);
        LayoutParams localLayoutParams = (LayoutParams)localView.getLayoutParams();
        if (!(localLayoutParams.a))
          break label380;
        switch (localLayoutParams.b & 0x7)
        {
        case 2:
        case 4:
        default:
          i3 = i1;
          i4 = i2;
          i2 = i1;
          i1 = i4;
          i9 = i3 + i6 - localView.getLeft();
          i3 = i1;
          i4 = i2;
          if (i9 == 0)
            break label168;
          localView.offsetLeftAndRight(i9);
          i4 = i2;
          i3 = i1;
        case 3:
        case 1:
        case 5:
        }
      }
    }
    while (true)
    {
      while (true)
      {
        while (true)
        {
          while (true)
          {
            while (true)
            {
              label168: i5 += 1;
              i1 = i4;
              i2 = i3;
            }
            i3 = localView.getWidth();
            i4 = i3 + i1;
            i3 = i1;
            i1 = i2;
            i2 = i4;
          }
          i3 = Math.max((i7 - localView.getMeasuredWidth()) / 2, i1);
          i4 = i1;
          i1 = i2;
          i2 = i4;
        }
        i3 = i7 - i2 - localView.getMeasuredWidth();
        i9 = localView.getMeasuredWidth();
        i4 = i1;
        i1 = i2 + i9;
        i2 = i4;
      }
      if (this.V != null)
        this.V.a(paramInt, paramFloat);
      if (this.W != null)
        this.W.a(paramInt, paramFloat);
      if (this.aa != null)
      {
        getScrollX();
        i1 = getChildCount();
        paramInt = 0;
        while (paramInt < i1)
        {
          localView = getChildAt(paramInt);
          if (!(((LayoutParams)localView.getLayoutParams()).a))
          {
            localView.getLeft();
            getWidth();
          }
          paramInt += 1;
        }
      }
      this.T = true;
      return;
      label380: i3 = i2;
      i4 = i1;
    }
  }

  private void a(int paramInt1, boolean paramBoolean1, int paramInt2, boolean paramBoolean2)
  {
    aw localaw = e(paramInt1);
    int i1 = 0;
    if (localaw != null)
      i1 = (int)(getWidth() * Math.max(this.r, Math.min(localaw.e, this.s)));
    if (paramBoolean1)
    {
      int i2;
      int i3;
      int i4;
      if (getChildCount() == 0)
        b(false);
      while (true)
      {
        if ((paramBoolean2) && (this.V != null))
          this.V.a(paramInt1);
        if ((paramBoolean2) && (this.W != null))
          this.W.a(paramInt1);
        return;
        i2 = getScrollX();
        i3 = getScrollY();
        i1 -= i2;
        i4 = 0 - i3;
        if ((i1 != 0) || (i4 != 0))
          break;
        a(false);
        d();
        b(0);
      }
      b(true);
      b(2);
      int i5 = getWidth();
      int i6 = i5 / 2;
      float f3 = Math.min(1.0F, 1.0F * Math.abs(i1) / i5);
      float f1 = i6;
      float f2 = i6;
      f3 = (float)Math.sin((float)((f3 - 0.5F) * 0.47123891676382D));
      paramInt2 = Math.abs(paramInt2);
      if (paramInt2 > 0);
      for (paramInt2 = Math.round(1000.0F * Math.abs((f2 * f3 + f1) / paramInt2)) * 4; ; paramInt2 = (int)((Math.abs(i1) / (f1 * 1.0F + this.n) + 1.0F) * 100.0F))
      {
        while (true)
        {
          paramInt2 = Math.min(paramInt2, 600);
          this.l.startScroll(i2, i3, i1, i4, paramInt2);
          ag.b(this);
        }
        f1 = i5;
      }
    }
    if ((paramBoolean2) && (this.V != null))
      this.V.a(paramInt1);
    if ((paramBoolean2) && (this.W != null))
      this.W.a(paramInt1);
    a(false);
    scrollTo(i1, 0);
  }

  private void a(int paramInt, boolean paramBoolean1, boolean paramBoolean2)
  {
    a(paramInt, paramBoolean1, paramBoolean2, 0);
  }

  private void a(int paramInt1, boolean paramBoolean1, boolean paramBoolean2, int paramInt2)
  {
    boolean bool = false;
    if ((this.g == null) || (this.g.a() <= 0))
    {
      b(false);
      return;
    }
    if ((!(paramBoolean2)) && (this.h == paramInt1) && (this.d.size() != 0))
    {
      b(false);
      return;
    }
    if (paramInt1 < 0);
    for (int i1 = 0; ; i1 = this.g.a() - 1)
      do
      {
        paramInt1 = this.y;
        if ((i1 <= this.h + paramInt1) && (i1 >= this.h - paramInt1))
          break label151;
        paramInt1 = 0;
        while (true)
        {
          if (paramInt1 >= this.d.size())
            break label151;
          ((aw)this.d.get(paramInt1)).c = true;
          paramInt1 += 1;
        }
        i1 = paramInt1;
      }
      while (paramInt1 < this.g.a());
    label151: paramBoolean2 = bool;
    if (this.h != i1)
      paramBoolean2 = true;
    d(i1);
    a(i1, paramBoolean1, paramInt2, paramBoolean2);
  }

  private void a(MotionEvent paramMotionEvent)
  {
    int i1 = r.a(paramMotionEvent);
    if (r.b(paramMotionEvent, i1) == this.I)
      if (i1 != 0)
        break label56;
    for (i1 = 1; ; i1 = 0)
    {
      this.E = r.c(paramMotionEvent, i1);
      this.I = r.b(paramMotionEvent, i1);
      if (this.J != null)
        this.J.clear();
      label56: return;
    }
  }

  private void a(boolean paramBoolean)
  {
    int i2;
    if (this.af == 2);
    for (int i1 = 1; ; i1 = 0)
    {
      if (i1 != 0)
      {
        b(false);
        this.l.abortAnimation();
        i2 = getScrollX();
        i3 = getScrollY();
        int i4 = this.l.getCurrX();
        int i5 = this.l.getCurrY();
        if ((i2 != i4) || (i3 != i5))
          scrollTo(i4, i5);
      }
      this.x = false;
      int i3 = 0;
      i2 = i1;
      i1 = i3;
      while (true)
      {
        if (i1 >= this.d.size())
          break label141;
        aw localaw = (aw)this.d.get(i1);
        if (localaw.c)
        {
          localaw.c = false;
          i2 = 1;
        }
        i1 += 1;
      }
    }
    if (i2 != 0)
    {
      label141: if (!(paramBoolean))
        break label158;
      ag.a(this, this.ae);
    }
    return;
    label158: this.ae.run();
  }

  private boolean a(float paramFloat)
  {
    int i2 = 1;
    boolean bool2 = false;
    boolean bool1 = false;
    float f1 = this.E;
    this.E = paramFloat;
    float f2 = getScrollX() + f1 - paramFloat;
    int i3 = getWidth();
    paramFloat = i3 * this.r;
    f1 = i3;
    float f3 = this.s;
    aw localaw1 = (aw)this.d.get(0);
    aw localaw2 = (aw)this.d.get(this.d.size() - 1);
    if (localaw1.b != 0)
      paramFloat = localaw1.e * i3;
    for (int i1 = 0; ; i1 = 1)
    {
      if (localaw2.b != this.g.a() - 1)
      {
        f1 = localaw2.e * i3;
        i2 = 0;
      }
      while (true)
      {
        if (f2 < paramFloat)
        {
          f1 = paramFloat;
          if (i1 != 0)
          {
            bool1 = this.P.a(Math.abs(paramFloat - f2) / i3);
            f1 = paramFloat;
          }
        }
        while (true)
        {
          this.E += f1 - (int)f1;
          scrollTo((int)f1, getScrollY());
          f((int)f1);
          return bool1;
          if (f2 > f1)
          {
            bool1 = bool2;
            if (i2 != 0)
              bool1 = this.Q.a(Math.abs(f2 - f1) / i3);
          }
          f1 = f2;
        }
        f1 *= f3;
      }
    }
  }

  private boolean a(View paramView, boolean paramBoolean, int paramInt1, int paramInt2, int paramInt3)
  {
    int i1;
    if (paramView instanceof ViewGroup)
    {
      ViewGroup localViewGroup = (ViewGroup)paramView;
      int i2 = paramView.getScrollX();
      int i3 = paramView.getScrollY();
      i1 = localViewGroup.getChildCount() - 1;
      if (i1 >= 0)
      {
        View localView = localViewGroup.getChildAt(i1);
        if ((paramInt2 + i2 < localView.getLeft()) || (paramInt2 + i2 >= localView.getRight()) || (paramInt3 + i3 < localView.getTop()) || (paramInt3 + i3 >= localView.getBottom()) || (!(a(localView, true, paramInt1, paramInt2 + i2 - localView.getLeft(), paramInt3 + i3 - localView.getTop()))));
      }
    }
    do
      while (true)
      {
        return true;
        i1 -= 1;
      }
    while ((paramBoolean) && (ag.a(paramView, -paramInt1)));
    return false;
  }

  private aw b(View paramView)
  {
    while (true)
    {
      ViewParent localViewParent = paramView.getParent();
      if (localViewParent == this)
        break;
      if ((localViewParent == null) || (!(localViewParent instanceof View)))
        return null;
      paramView = (View)localViewParent;
    }
    return a(paramView);
  }

  private void b(int paramInt)
  {
    if (this.af == paramInt);
    do
    {
      int i1;
      int i2;
      return;
      this.af = paramInt;
      if (this.aa == null)
        continue;
      if (paramInt != 0)
      {
        i1 = 1;
        int i4 = getChildCount();
        i2 = 0;
        if (i2 >= i4)
          continue;
        if (i1 == 0)
          break label70;
      }
      label70: for (int i3 = 2; ; i3 = 0)
        while (true)
        {
          while (true)
          {
            ag.b(getChildAt(i2), i3);
            i2 += 1;
          }
          i1 = 0;
        }
    }
    while (this.V == null);
    this.V.b(paramInt);
  }

  private void b(boolean paramBoolean)
  {
    if (this.w == paramBoolean)
      return;
    this.w = paramBoolean;
  }

  private void c(int paramInt)
  {
    this.x = false;
    a(paramInt, true, false);
  }

  private void d(int paramInt)
  {
    aw localaw;
    if (this.h != paramInt)
    {
      localaw = e(this.h);
      this.h = paramInt;
    }
    while (true)
    {
      Object localObject1;
      if (this.g == null);
      do
        return;
      while ((this.x) || (getWindowToken() == null));
      paramInt = this.y;
      int i7 = Math.max(0, this.h - paramInt);
      int i5 = this.g.a();
      int i6 = Math.min(i5 - 1, paramInt + this.h);
      paramInt = 0;
      if (paramInt < this.d.size())
      {
        localObject1 = (aw)this.d.get(paramInt);
        if (((aw)localObject1).b >= this.h)
          if (((aw)localObject1).b != this.h)
            break label1724;
      }
      while (true)
      {
        if ((localObject1 == null) && (i5 > 0));
        for (Object localObject2 = a(this.h, paramInt); ; localObject2 = localObject1)
        {
          float f1;
          float f2;
          float f3;
          int i1;
          int i2;
          int i3;
          int i4;
          if (localObject2 != null)
          {
            Object localObject3;
            i4 = paramInt - 1;
            if (i4 >= 0)
            {
              localObject1 = (aw)this.d.get(i4);
              f3 = ((aw)localObject2).d;
              i1 = this.h;
              f2 = 0.0F;
              i3 = i1 - 1;
              i2 = paramInt;
              localObject3 = localObject1;
              if (i3 < 0)
                break label495;
              if ((f2 < 2.0F - f3) || (i3 >= i7))
                break label377;
              if (localObject3 == null)
                break label495;
              localObject1 = localObject3;
              paramInt = i4;
              f1 = f2;
              i1 = i2;
              if (i3 == localObject3.b)
              {
                localObject1 = localObject3;
                paramInt = i4;
                f1 = f2;
                i1 = i2;
                if (!(localObject3.c))
                {
                  this.d.remove(i4);
                  this.g.b(this, i3);
                  paramInt = i4 - 1;
                  i1 = i2 - 1;
                  if (paramInt < 0)
                    break label369;
                  localObject1 = (aw)this.d.get(paramInt);
                  f1 = f2;
                }
              }
            }
            while (true)
            {
              while (true)
              {
                while (true)
                {
                  while (true)
                  {
                    i3 -= 1;
                    localObject3 = localObject1;
                    i4 = paramInt;
                    f2 = f1;
                    i2 = i1;
                  }
                  paramInt += 1;
                }
                localObject1 = null;
              }
              label369: localObject1 = null;
              f1 = f2;
              continue;
              if ((localObject3 != null) && (i3 == localObject3.b))
              {
                label377: f1 = f2 + localObject3.d;
                paramInt = i4 - 1;
                if (paramInt >= 0)
                {
                  localObject1 = (aw)this.d.get(paramInt);
                  i1 = i2;
                }
                localObject1 = null;
                i1 = i2;
              }
              f1 = f2 + a(i3, i4 + 1).d;
              i1 = i2 + 1;
              if (i4 >= 0)
              {
                localObject1 = (aw)this.d.get(i4);
                paramInt = i4;
              }
              localObject1 = null;
              paramInt = i4;
            }
            label495: f1 = ((aw)localObject2).d;
            paramInt = i2 + 1;
            if (f1 < 2.0F)
              if (paramInt < this.d.size())
              {
                localObject1 = (aw)this.d.get(paramInt);
                i1 = this.h + 1;
                if (i1 >= i5)
                  break label769;
                if ((f1 < 2.0F) || (i1 <= i6))
                  break label651;
                if (localObject1 == null)
                  break label769;
                if ((i1 != ((aw)localObject1).b) || (((aw)localObject1).c))
                  break label1714;
                this.d.remove(paramInt);
                this.g.b(this, i1);
                if (paramInt >= this.d.size())
                  break label645;
                localObject1 = (aw)this.d.get(paramInt);
              }
          }
          while (true)
          {
            while (true)
            {
              while (true)
                i1 += 1;
              localObject1 = null;
            }
            label645: localObject1 = null;
            continue;
            if ((localObject1 != null) && (i1 == ((aw)localObject1).b))
            {
              label651: f2 = ((aw)localObject1).d;
              paramInt += 1;
              if (paramInt < this.d.size());
              for (localObject1 = (aw)this.d.get(paramInt); ; localObject1 = null)
                while (true)
                  f1 += f2;
            }
            localObject1 = a(i1, paramInt);
            paramInt += 1;
            f2 = ((aw)localObject1).d;
            if (paramInt < this.d.size());
            for (localObject1 = (aw)this.d.get(paramInt); ; localObject1 = null)
              while (true)
                f1 += f2;
            label769: i3 = this.g.a();
            paramInt = getWidth();
            if (paramInt > 0)
              f2 = this.n / paramInt;
            while (localaw != null)
            {
              paramInt = localaw.b;
              if (paramInt >= ((aw)localObject2).b)
                break;
              f1 = localaw.e;
              f3 = localaw.d;
              i1 = 0;
              f1 = f3 + f1 + f2;
              paramInt += 1;
              if ((paramInt > ((aw)localObject2).b) || (i1 >= this.d.size()))
                break;
              for (localObject1 = (aw)this.d.get(i1); ; localObject1 = (aw)this.d.get(i1))
              {
                if ((paramInt <= ((aw)localObject1).b) || (i1 >= this.d.size() - 1))
                  break label1711;
                i1 += 1;
              }
              f2 = 0.0F;
            }
            while (true)
            {
              while (true)
              {
                if (paramInt < ((aw)localObject1).b)
                {
                  paramInt += 1;
                  f1 = 1.0F + f2 + f1;
                }
                ((aw)localObject1).e = f1;
                f1 += ((aw)localObject1).d + f2;
                paramInt += 1;
              }
              if (paramInt > ((aw)localObject2).b)
              {
                i1 = this.d.size();
                f1 = localaw.e;
                i1 -= 1;
                paramInt -= 1;
                if ((paramInt >= ((aw)localObject2).b) && (i1 >= 0))
                  for (localObject1 = (aw)this.d.get(i1); (paramInt < ((aw)localObject1).b) && (i1 > 0); localObject1 = (aw)this.d.get(i1))
                    i1 -= 1;
              }
              while (true)
              {
                do
                {
                  while (true)
                  {
                    if (paramInt > ((aw)localObject1).b)
                    {
                      paramInt -= 1;
                      f1 -= 1.0F + f2;
                    }
                    f1 -= ((aw)localObject1).d + f2;
                    ((aw)localObject1).e = f1;
                    paramInt -= 1;
                  }
                  i4 = this.d.size();
                  f3 = ((aw)localObject2).e;
                  paramInt = ((aw)localObject2).b - 1;
                  if (((aw)localObject2).b == 0)
                  {
                    f1 = ((aw)localObject2).e;
                    this.r = f1;
                    if (((aw)localObject2).b != i3 - 1)
                      break label1248;
                    f1 = ((aw)localObject2).e + ((aw)localObject2).d - 1.0F;
                    this.s = f1;
                    i1 = i2 - 1;
                    f1 = f3;
                  }
                  while (i1 >= 0)
                  {
                    while (true)
                    {
                      while (true)
                      {
                        localObject1 = (aw)this.d.get(i1);
                        while (true)
                        {
                          if (paramInt <= ((aw)localObject1).b)
                            break label1254;
                          paramInt -= 1;
                          f1 -= 1.0F + f2;
                        }
                        f1 = -3.402824E+038F;
                      }
                      label1248: f1 = 3.4028235E+38F;
                    }
                    label1254: f1 -= ((aw)localObject1).d + f2;
                    ((aw)localObject1).e = f1;
                    if (((aw)localObject1).b == 0)
                      this.r = f1;
                    paramInt -= 1;
                    i1 -= 1;
                  }
                  f1 = ((aw)localObject2).e + ((aw)localObject2).d + f2;
                  paramInt = ((aw)localObject2).b + 1;
                  i1 = i2 + 1;
                  while (i1 < i4)
                  {
                    localObject1 = (aw)this.d.get(i1);
                    while (paramInt < ((aw)localObject1).b)
                    {
                      paramInt += 1;
                      f1 += 1.0F + f2;
                    }
                    if (((aw)localObject1).b == i3 - 1)
                      this.s = (((aw)localObject1).d + f1 - 1.0F);
                    ((aw)localObject1).e = f1;
                    f1 += ((aw)localObject1).d + f2;
                    paramInt += 1;
                    i1 += 1;
                  }
                  this.S = false;
                  if (this.ab != 0)
                  {
                    paramInt = 1;
                    if (paramInt != 0)
                    {
                      if (this.ac != null)
                        break label1577;
                      this.ac = new ArrayList();
                    }
                  }
                  while (true)
                  {
                    while (true)
                    {
                      i2 = getChildCount();
                      i1 = 0;
                      while (true)
                      {
                        if (i1 >= i2)
                          break label1587;
                        localObject1 = getChildAt(i1);
                        localObject2 = (LayoutParams)((View)localObject1).getLayoutParams();
                        ((LayoutParams)localObject2).f = i1;
                        if ((!(((LayoutParams)localObject2).a)) && (((LayoutParams)localObject2).c == 0.0F))
                        {
                          localaw = a((View)localObject1);
                          if (localaw != null)
                          {
                            ((LayoutParams)localObject2).c = localaw.d;
                            ((LayoutParams)localObject2).e = localaw.b;
                          }
                        }
                        if (paramInt != 0)
                          this.ac.add(localObject1);
                        i1 += 1;
                      }
                      paramInt = 0;
                    }
                    label1577: this.ac.clear();
                  }
                  label1587: if (paramInt == 0)
                    continue;
                  Collections.sort(this.ac, ad);
                }
                while (!(hasFocus()));
                localObject1 = findFocus();
                if (localObject1 != null);
                for (localObject1 = b((View)localObject1); ; localObject1 = null)
                {
                  if ((localObject1 == null) || (((aw)localObject1).b != this.h));
                  paramInt = 0;
                  while (true)
                  {
                    do
                    {
                      if (paramInt < getChildCount());
                      localObject1 = getChildAt(paramInt);
                      localObject2 = a((View)localObject1);
                    }
                    while ((localObject2 != null) && (((aw)localObject2).b == this.h) && (((View)localObject1).requestFocus(2)));
                    label1711: label1714: paramInt += 1;
                  }
                }
              }
            }
          }
        }
        label1724: localObject1 = null;
      }
      localaw = null;
    }
  }

  private aw e(int paramInt)
  {
    int i1 = 0;
    while (i1 < this.d.size())
    {
      aw localaw = (aw)this.d.get(i1);
      if (localaw.b == paramInt)
        return localaw;
      i1 += 1;
    }
    return null;
  }

  private void f()
  {
    setWillNotDraw(false);
    setDescendantFocusability(262144);
    setFocusable(true);
    Context localContext = getContext();
    this.l = new Scroller(localContext, c);
    ViewConfiguration localViewConfiguration = ViewConfiguration.get(localContext);
    float f1 = localContext.getResources().getDisplayMetrics().density;
    this.D = ao.a(localViewConfiguration);
    this.K = (int)(400.0F * f1);
    this.L = localViewConfiguration.getScaledMaximumFlingVelocity();
    this.P = new a(localContext);
    this.Q = new a(localContext);
    this.M = (int)(25.0F * f1);
    this.N = (int)(2.0F * f1);
    this.B = (int)(16.0F * f1);
    ag.a(this, new ax(this));
    if (ag.c(this) != 0)
      return;
    ag.d(this);
  }

  private boolean f(int paramInt)
  {
    int i3 = 0;
    if (this.d.size() == 0)
    {
      this.T = false;
      a(0, 0.0F);
      if (this.T)
        break label122;
      throw new IllegalStateException("onPageScrolled did not call superclass implementation");
    }
    aw localaw = g();
    int i1 = getWidth();
    float f1 = this.n / i1;
    int i2 = localaw.b;
    f1 = (paramInt / i1 - localaw.e) / (localaw.d + f1);
    this.T = false;
    a(i2, f1);
    if (!(this.T))
      throw new IllegalStateException("onPageScrolled did not call superclass implementation");
    i3 = 1;
    label122: return i3;
  }

  private aw g()
  {
    float f1;
    float f2;
    float f3;
    float f4;
    int i2;
    int i3;
    aw localaw;
    Object localObject1;
    Object localObject2;
    int i1 = getWidth();
    if (i1 > 0)
    {
      f1 = getScrollX() / i1;
      if (i1 <= 0)
        break label203;
      f2 = this.n / i1;
      f4 = 0.0F;
      f3 = 0.0F;
      i3 = -1;
      i1 = 0;
      i2 = 1;
      localObject1 = null;
      localObject2 = localObject1;
      if (i1 < this.d.size())
      {
        localaw = (aw)this.d.get(i1);
        if ((i2 != 0) || (localaw.b == i3 + 1))
          break label238;
        localaw = this.e;
        localaw.e = (f4 + f3 + f2);
        localaw.b = (i3 + 1);
        localaw.d = 1.0F;
        i1 -= 1;
      }
    }
    label195: label203: label208: label238: 
    while (true)
      while (true)
      {
        while (true)
        {
          while (true)
          {
            f3 = localaw.e;
            f4 = localaw.d;
            if (i2 == 0)
            {
              localObject2 = localObject1;
              if (f1 < f3)
                break label195;
            }
            if ((f1 >= f4 + f3 + f2) && (i1 != this.d.size() - 1))
              break label208;
            localObject2 = localaw;
            return localObject2;
            f1 = 0.0F;
          }
          f2 = 0.0F;
        }
        i3 = localaw.b;
        f4 = localaw.d;
        i2 = 0;
        i1 += 1;
        localObject1 = localaw;
      }
  }

  private boolean g(int paramInt)
  {
    int i1;
    int i2;
    boolean bool = false;
    View localView2 = findFocus();
    View localView1 = localView2;
    if (localView2 == this)
      localView1 = null;
    localView2 = FocusFinder.getInstance().findNextFocus(this, localView1, paramInt);
    if ((localView2 != null) && (localView2 != localView1))
      if (paramInt == 17)
      {
        i1 = a(this.f, localView2).left;
        i2 = a(this.f, localView1).left;
        if ((localView1 == null) || (i1 < i2));
      }
    for (bool = i(); ; bool = false)
      while (true)
      {
        if (bool)
          playSoundEffect(SoundEffectConstants.getContantForFocusDirection(paramInt));
        return bool;
        bool = localView2.requestFocus();
        continue;
        if (paramInt != 66)
          continue;
        i1 = a(this.f, localView2).left;
        i2 = a(this.f, localView1).left;
        if ((localView1 == null) || (i1 > i2))
        {
          bool = localView2.requestFocus();
          continue;
          if ((paramInt == 17) || (paramInt == 1))
            bool = i();
          if ((paramInt != 66) && (paramInt != 2))
            continue;
        }
        if ((this.g == null) || (this.h >= this.g.a() - 1))
          break;
        c(this.h + 1);
        bool = true;
      }
  }

  private void h()
  {
    this.z = false;
    this.A = false;
    if (this.J == null)
      return;
    this.J.recycle();
    this.J = null;
  }

  private boolean i()
  {
    if (this.h > 0)
    {
      c(this.h - 1);
      return true;
    }
    return false;
  }

  public final v a()
  {
    return this.g;
  }

  public final void a(int paramInt)
  {
    this.x = false;
    if (!(this.R));
    for (boolean bool = true; ; bool = false)
    {
      a(paramInt, bool, false);
      return;
    }
  }

  final void a(ay paramay)
  {
    this.Z = paramay;
  }

  public final void a(az paramaz)
  {
    this.V = paramaz;
  }

  public final void a(v paramv)
  {
    if (this.g != null)
    {
      int i2;
      this.g.b(this.m);
      int i1 = 0;
      while (i1 < this.d.size())
      {
        localObject = (aw)this.d.get(i1);
        this.g.b(this, ((aw)localObject).b);
        i1 += 1;
      }
      this.d.clear();
      for (i1 = 0; i1 < getChildCount(); i1 = i2 + 1)
      {
        i2 = i1;
        if (((LayoutParams)getChildAt(i1).getLayoutParams()).a)
          continue;
        removeViewAt(i1);
        i2 = i1 - 1;
      }
      this.h = 0;
      scrollTo(0, 0);
    }
    Object localObject = this.g;
    this.g = paramv;
    if (this.g != null)
    {
      if (this.m == null)
        this.m = new bb(this, 0);
      this.g.a(this.m);
      this.x = false;
      this.R = true;
      if (this.i < 0)
        break label244;
      a(this.i, false, true);
      this.i = -1;
      this.j = null;
      this.k = null;
    }
    while (true)
    {
      if ((this.Z != null) && (localObject != paramv))
        this.Z.a((v)localObject, paramv);
      return;
      label244: d();
    }
  }

  public void addFocusables(ArrayList paramArrayList, int paramInt1, int paramInt2)
  {
    int i2 = paramArrayList.size();
    int i3 = getDescendantFocusability();
    if (i3 != 393216)
    {
      int i1 = 0;
      while (i1 < getChildCount())
      {
        View localView = getChildAt(i1);
        if (localView.getVisibility() == 0)
        {
          aw localaw = a(localView);
          if ((localaw != null) && (localaw.b == this.h))
            localView.addFocusables(paramArrayList, paramInt1, paramInt2);
        }
        i1 += 1;
      }
    }
    if (((i3 == 262144) && (i2 != paramArrayList.size())) || (!(isFocusable())));
    do
      return;
    while ((((paramInt2 & 0x1) == 1) && (isInTouchMode()) && (!(isFocusableInTouchMode()))) || (paramArrayList == null));
    paramArrayList.add(this);
  }

  public void addTouchables(ArrayList paramArrayList)
  {
    int i1 = 0;
    while (i1 < getChildCount())
    {
      View localView = getChildAt(i1);
      if (localView.getVisibility() == 0)
      {
        aw localaw = a(localView);
        if ((localaw != null) && (localaw.b == this.h))
          localView.addTouchables(paramArrayList);
      }
      i1 += 1;
    }
  }

  public void addView(View paramView, int paramInt, ViewGroup.LayoutParams paramLayoutParams)
  {
    if (!(checkLayoutParams(paramLayoutParams)))
      paramLayoutParams = generateLayoutParams(paramLayoutParams);
    while (true)
    {
      LayoutParams localLayoutParams = (LayoutParams)paramLayoutParams;
      localLayoutParams.a |= paramView instanceof av;
      if (this.v)
      {
        if ((localLayoutParams != null) && (localLayoutParams.a))
          throw new IllegalStateException("Cannot add pager decor view during layout");
        localLayoutParams.d = true;
        addViewInLayout(paramView, paramInt, paramLayoutParams);
        return;
      }
      super.addView(paramView, paramInt, paramLayoutParams);
      return;
    }
  }

  public final int b()
  {
    return this.h;
  }

  final az b(az paramaz)
  {
    az localaz = this.W;
    this.W = paramaz;
    return localaz;
  }

  final void c()
  {
    int i3;
    if ((this.d.size() < this.y * 2 + 1) && (this.d.size() < this.g.a()));
    for (int i1 = 1; ; i1 = 0)
    {
      i3 = this.h;
      i2 = 0;
      while (true)
      {
        if (i2 >= this.d.size())
          break label76;
        this.d.get(i2);
        i2 += 1;
      }
    }
    label76: Collections.sort(this.d, b);
    if (i1 == 0)
      return;
    int i2 = getChildCount();
    i1 = 0;
    while (i1 < i2)
    {
      LayoutParams localLayoutParams = (LayoutParams)getChildAt(i1).getLayoutParams();
      if (!(localLayoutParams.a))
        localLayoutParams.c = 0.0F;
      i1 += 1;
    }
    a(i3, false, true);
    requestLayout();
  }

  protected boolean checkLayoutParams(ViewGroup.LayoutParams paramLayoutParams)
  {
    return ((!(paramLayoutParams instanceof LayoutParams)) || (!(super.checkLayoutParams(paramLayoutParams))));
  }

  public void computeScroll()
  {
    if ((!(this.l.isFinished())) && (this.l.computeScrollOffset()))
    {
      int i1 = getScrollX();
      int i2 = getScrollY();
      int i3 = this.l.getCurrX();
      int i4 = this.l.getCurrY();
      if ((i1 != i3) || (i2 != i4))
      {
        scrollTo(i3, i4);
        if (!(f(i3)))
        {
          this.l.abortAnimation();
          scrollTo(0, i4);
        }
      }
      ag.b(this);
      return;
    }
    a(true);
  }

  final void d()
  {
    d(this.h);
  }

  public boolean dispatchKeyEvent(KeyEvent paramKeyEvent)
  {
    int i1 = 0;
    if (!(super.dispatchKeyEvent(paramKeyEvent)))
      if (paramKeyEvent.getAction() == 0)
        switch (paramKeyEvent.getKeyCode())
        {
        default:
        case 21:
        case 22:
        case 61:
        }
    for (boolean bool = false; ; bool = g(1))
      do
        while (true)
        {
          do
            while (true)
            {
              if (bool)
                i1 = 1;
              return i1;
              bool = g(17);
              continue;
              bool = g(66);
            }
          while (Build.VERSION.SDK_INT < 11);
          if (!(n.b(paramKeyEvent)))
            break;
          bool = g(2);
        }
      while (!(n.a(paramKeyEvent)));
  }

  public boolean dispatchPopulateAccessibilityEvent(AccessibilityEvent paramAccessibilityEvent)
  {
    int i4 = 0;
    int i2 = getChildCount();
    int i1 = 0;
    while (true)
    {
      int i3 = i4;
      if (i1 < i2)
      {
        View localView = getChildAt(i1);
        if (localView.getVisibility() != 0)
          break label74;
        aw localaw = a(localView);
        if ((localaw == null) || (localaw.b != this.h) || (!(localView.dispatchPopulateAccessibilityEvent(paramAccessibilityEvent))))
          break label74;
        i3 = 1;
      }
      return i3;
      label74: i1 += 1;
    }
  }

  public void draw(Canvas paramCanvas)
  {
    boolean bool;
    super.draw(paramCanvas);
    int i3 = 0;
    int i1 = 0;
    int i4 = ag.a(this);
    if ((i4 == 0) || ((i4 == 1) && (this.g != null) && (this.g.a() > 1)))
    {
      int i2;
      if (!(this.P.a()))
      {
        i3 = paramCanvas.save();
        i1 = getHeight() - getPaddingTop() - getPaddingBottom();
        i4 = getWidth();
        paramCanvas.rotate(270.0F);
        paramCanvas.translate(-i1 + getPaddingTop(), this.r * i4);
        this.P.a(i1, i4);
        i2 = this.P.a(paramCanvas) | false;
        paramCanvas.restoreToCount(i3);
      }
      i3 = i2;
      if (!(this.Q.a()))
      {
        i4 = paramCanvas.save();
        i3 = getWidth();
        int i5 = getHeight();
        int i6 = getPaddingTop();
        int i7 = getPaddingBottom();
        paramCanvas.rotate(90.0F);
        paramCanvas.translate(-getPaddingTop(), -(this.s + 1.0F) * i3);
        this.Q.a(i5 - i6 - i7, i3);
        bool = i2 | this.Q.a(paramCanvas);
        paramCanvas.restoreToCount(i4);
      }
    }
    while (true)
    {
      if (bool)
        ag.b(this);
      return;
      this.P.b();
      this.Q.b();
    }
  }

  protected void drawableStateChanged()
  {
    super.drawableStateChanged();
    Drawable localDrawable = this.o;
    if ((localDrawable == null) || (!(localDrawable.isStateful())))
      return;
    localDrawable.setState(getDrawableState());
  }

  protected ViewGroup.LayoutParams generateDefaultLayoutParams()
  {
    return new LayoutParams();
  }

  public ViewGroup.LayoutParams generateLayoutParams(AttributeSet paramAttributeSet)
  {
    return new LayoutParams(getContext(), paramAttributeSet);
  }

  protected ViewGroup.LayoutParams generateLayoutParams(ViewGroup.LayoutParams paramLayoutParams)
  {
    return generateDefaultLayoutParams();
  }

  protected int getChildDrawingOrder(int paramInt1, int paramInt2)
  {
    int i1 = paramInt2;
    if (this.ab == 2)
      i1 = paramInt1 - 1 - paramInt2;
    return ((LayoutParams)((View)this.ac.get(i1)).getLayoutParams()).f;
  }

  protected void onAttachedToWindow()
  {
    super.onAttachedToWindow();
    this.R = true;
  }

  protected void onDetachedFromWindow()
  {
    removeCallbacks(this.ae);
    super.onDetachedFromWindow();
  }

  protected void onDraw(Canvas paramCanvas)
  {
    float f2;
    super.onDraw(paramCanvas);
    if ((this.n <= 0) || (this.o == null) || (this.d.size() <= 0) || (this.g == null))
      return;
    int i3 = getScrollX();
    int i4 = getWidth();
    float f3 = this.n / i4;
    Object localObject = (aw)this.d.get(0);
    float f1 = ((aw)localObject).e;
    int i5 = this.d.size();
    int i1 = ((aw)localObject).b;
    int i6 = ((aw)this.d.get(i5 - 1)).b;
    int i2 = 0;
    if (i1 >= i6)
      return;
    while ((i1 > ((aw)localObject).b) && (i2 < i5))
    {
      localObject = this.d;
      i2 += 1;
      localObject = (aw)((ArrayList)localObject).get(i2);
    }
    if (i1 == ((aw)localObject).b)
    {
      f2 = (((aw)localObject).e + ((aw)localObject).d) * i4;
      f1 = ((aw)localObject).e + ((aw)localObject).d + f3;
    }
    while (true)
    {
      while (true)
      {
        if (this.n + f2 > i3)
        {
          this.o.setBounds((int)f2, this.p, (int)(this.n + f2 + 0.5F), this.q);
          this.o.draw(paramCanvas);
        }
        if (f2 > i3 + i4)
          return;
        i1 += 1;
      }
      f2 = (1.0F + f1) * i4;
      f1 += 1.0F + f3;
    }
  }

  public boolean onInterceptTouchEvent(MotionEvent paramMotionEvent)
  {
    int i1 = paramMotionEvent.getAction() & 0xFF;
    if ((i1 == 3) || (i1 == 1))
    {
      this.z = false;
      this.A = false;
      this.I = -1;
      if (this.J != null)
      {
        this.J.recycle();
        this.J = null;
      }
    }
    do
    {
      return false;
      if (i1 == 0)
        break;
      if (this.z)
        return true;
    }
    while (this.A);
    switch (i1)
    {
    default:
    case 2:
    case 0:
    case 6:
    }
    while (true)
    {
      if (this.J == null)
        this.J = VelocityTracker.obtain();
      this.J.addMovement(paramMotionEvent);
      return this.z;
      i1 = this.I;
      if (i1 == -1)
        continue;
      i1 = r.a(paramMotionEvent, i1);
      float f2 = r.c(paramMotionEvent, i1);
      float f1 = f2 - this.E;
      float f4 = Math.abs(f1);
      float f3 = r.d(paramMotionEvent, i1);
      float f5 = Math.abs(f3 - this.H);
      if (f1 != 0.0F)
      {
        float f6 = this.E;
        if (((f6 < this.C) && (f1 > 0.0F)) || ((f6 > getWidth() - this.C) && (f1 < 0.0F)));
        for (i1 = 1; (i1 == 0) && (a(this, false, (int)f1, (int)f2, (int)f3)); i1 = 0)
        {
          this.E = f2;
          this.F = f3;
          this.A = true;
          return false;
        }
      }
      if ((f4 > this.D) && (0.5F * f4 > f5))
      {
        this.z = true;
        b(1);
        if (f1 > 0.0F)
        {
          f1 = this.G + this.D;
          this.E = f1;
          this.F = f3;
          b(true);
        }
      }
      while (true)
      {
        while (true)
        {
          while (true)
          {
            if ((this.z) && (a(f2)));
            ag.b(this);
          }
          f1 = this.G - this.D;
        }
        if (f5 <= this.D)
          continue;
        this.A = true;
      }
      f1 = paramMotionEvent.getX();
      this.G = f1;
      this.E = f1;
      f1 = paramMotionEvent.getY();
      this.H = f1;
      this.F = f1;
      this.I = r.b(paramMotionEvent, 0);
      this.A = false;
      this.l.computeScrollOffset();
      if ((this.af == 2) && (Math.abs(this.l.getFinalX() - this.l.getCurrX()) > this.N))
      {
        this.l.abortAnimation();
        this.x = false;
        d();
        this.z = true;
        b(1);
      }
      a(false);
      this.z = false;
      continue;
      a(paramMotionEvent);
    }
  }

  protected void onLayout(boolean paramBoolean, int paramInt1, int paramInt2, int paramInt3, int paramInt4)
  {
    int i1;
    int i3;
    int i5;
    int i10;
    View localView;
    LayoutParams localLayoutParams;
    this.v = true;
    d();
    this.v = false;
    int i6 = getChildCount();
    int i7 = paramInt3 - paramInt1;
    int i8 = paramInt4 - paramInt2;
    paramInt2 = getPaddingLeft();
    paramInt1 = getPaddingTop();
    paramInt4 = getPaddingRight();
    paramInt3 = getPaddingBottom();
    int i9 = getScrollX();
    int i2 = 0;
    int i4 = 0;
    if (i4 < i6)
    {
      localView = getChildAt(i4);
      if (localView.getVisibility() == 8)
        break label657;
      localLayoutParams = (LayoutParams)localView.getLayoutParams();
      if (!(localLayoutParams.a))
        break label657;
      i1 = localLayoutParams.b;
      i10 = localLayoutParams.b;
      switch (i1 & 0x7)
      {
      case 2:
      case 4:
      default:
        i1 = paramInt2;
        i3 = paramInt2;
        switch (i10 & 0x70)
        {
        default:
          i5 = paramInt1;
          paramInt2 = paramInt1;
          paramInt1 = paramInt3;
          paramInt3 = i5;
          i1 += i9;
          localView.layout(i1, paramInt3, localView.getMeasuredWidth() + i1, localView.getMeasuredHeight() + paramInt3);
          i2 += 1;
          paramInt3 = i3;
          i1 = paramInt1;
          paramInt1 = i2;
        case 48:
        case 16:
        case 80:
        }
      case 3:
      case 1:
      case 5:
      }
    }
    while (true)
    {
      while (true)
      {
        while (true)
        {
          while (true)
          {
            while (true)
            {
              while (true)
              {
                while (true)
                {
                  while (true)
                  {
                    i4 += 1;
                    i3 = paramInt3;
                    i2 = paramInt1;
                    paramInt1 = paramInt2;
                    paramInt3 = i1;
                    paramInt2 = i3;
                  }
                  i3 = localView.getMeasuredWidth();
                  i1 = paramInt2;
                  i3 += paramInt2;
                }
                i1 = Math.max((i7 - localView.getMeasuredWidth()) / 2, paramInt2);
                i3 = paramInt2;
              }
              i3 = localView.getMeasuredWidth();
              i1 = paramInt4 + localView.getMeasuredWidth();
              i5 = i7 - paramInt4 - i3;
              paramInt4 = i1;
              i3 = paramInt2;
              i1 = i5;
            }
            i5 = localView.getMeasuredHeight();
            paramInt2 = paramInt3;
            i5 += paramInt1;
            paramInt3 = paramInt1;
            paramInt1 = paramInt2;
            paramInt2 = i5;
          }
          i5 = Math.max((i8 - localView.getMeasuredHeight()) / 2, paramInt1);
          paramInt2 = paramInt1;
          paramInt1 = paramInt3;
          paramInt3 = i5;
        }
        i5 = i8 - paramInt3 - localView.getMeasuredHeight();
        i10 = localView.getMeasuredHeight();
        paramInt2 = paramInt1;
        paramInt1 = paramInt3 + i10;
        paramInt3 = i5;
      }
      i1 = 0;
      while (i1 < i6)
      {
        localView = getChildAt(i1);
        if (localView.getVisibility() != 8)
        {
          localLayoutParams = (LayoutParams)localView.getLayoutParams();
          if (!(localLayoutParams.a))
          {
            aw localaw = a(localView);
            if (localaw != null)
            {
              float f1 = i7;
              i3 = (int)(localaw.e * f1) + paramInt2;
              if (localLayoutParams.d)
              {
                localLayoutParams.d = false;
                f1 = i7 - paramInt2 - paramInt4;
                localView.measure(View.MeasureSpec.makeMeasureSpec((int)(localLayoutParams.c * f1), 1073741824), View.MeasureSpec.makeMeasureSpec(i8 - paramInt1 - paramInt3, 1073741824));
              }
              localView.layout(i3, paramInt1, localView.getMeasuredWidth() + i3, localView.getMeasuredHeight() + paramInt1);
            }
          }
        }
        i1 += 1;
      }
      this.p = paramInt1;
      this.q = (i8 - paramInt3);
      this.U = i2;
      this.R = false;
      return;
      label657: i1 = i2;
      i2 = paramInt1;
      i3 = paramInt2;
      paramInt1 = i1;
      i1 = paramInt3;
      paramInt2 = i2;
      paramInt3 = i3;
    }
  }

  protected void onMeasure(int paramInt1, int paramInt2)
  {
    int i2;
    int i4;
    int i5;
    int i6;
    View localView;
    LayoutParams localLayoutParams;
    setMeasuredDimension(getDefaultSize(0, paramInt1), getDefaultSize(0, paramInt2));
    paramInt1 = getMeasuredWidth();
    this.C = Math.min(paramInt1 / 10, this.B);
    paramInt1 = paramInt1 - getPaddingLeft() - getPaddingRight();
    paramInt2 = getMeasuredHeight() - getPaddingTop() - getPaddingBottom();
    int i9 = getChildCount();
    int i3 = 0;
    if (i3 < i9)
    {
      localView = getChildAt(i3);
      i1 = paramInt1;
      i2 = paramInt2;
      if (localView.getVisibility() != 8)
      {
        localLayoutParams = (LayoutParams)localView.getLayoutParams();
        i1 = paramInt1;
        i2 = paramInt2;
        if (localLayoutParams != null)
        {
          i1 = paramInt1;
          i2 = paramInt2;
          if (localLayoutParams.a)
          {
            i1 = localLayoutParams.b & 0x7;
            i4 = localLayoutParams.b & 0x70;
            i6 = -2147483648;
            i2 = -2147483648;
            if ((i4 != 48) && (i4 != 80))
              break label333;
            i4 = 1;
            if ((i1 != 3) && (i1 != 5))
              break label339;
            i5 = 1;
            if (i4 == 0)
              break label345;
            i1 = 1073741824;
            if (localLayoutParams.width == -2)
              break label528;
            i6 = 1073741824;
            if (localLayoutParams.width == -1)
              break label522;
          }
        }
      }
    }
    for (int i1 = localLayoutParams.width; ; i1 = paramInt1)
    {
      while (true)
      {
        int i8;
        if (localLayoutParams.height != -2)
        {
          i7 = 1073741824;
          i2 = i7;
          if (localLayoutParams.height != -1)
          {
            i8 = localLayoutParams.height;
            i2 = i7;
          }
        }
        for (int i7 = i8; ; i7 = paramInt2)
        {
          localView.measure(View.MeasureSpec.makeMeasureSpec(i1, i6), View.MeasureSpec.makeMeasureSpec(i7, i2));
          if (i4 != 0)
          {
            i2 = paramInt2 - localView.getMeasuredHeight();
            i1 = paramInt1;
          }
          while (true)
          {
            while (true)
            {
              do
              {
                while (true)
                {
                  while (true)
                  {
                    while (true)
                    {
                      i3 += 1;
                      paramInt1 = i1;
                      paramInt2 = i2;
                    }
                    label333: i4 = 0;
                  }
                  label339: i5 = 0;
                }
                label345: i1 = i6;
              }
              while (i5 == 0);
              i2 = 1073741824;
              i1 = i6;
            }
            i1 = paramInt1;
            i2 = paramInt2;
            if (i5 == 0)
              continue;
            i1 = paramInt1 - localView.getMeasuredWidth();
            i2 = paramInt2;
          }
          this.t = View.MeasureSpec.makeMeasureSpec(paramInt1, 1073741824);
          this.u = View.MeasureSpec.makeMeasureSpec(paramInt2, 1073741824);
          this.v = true;
          d();
          this.v = false;
          i1 = getChildCount();
          paramInt2 = 0;
          while (paramInt2 < i1)
          {
            localView = getChildAt(paramInt2);
            if (localView.getVisibility() != 8)
            {
              localLayoutParams = (LayoutParams)localView.getLayoutParams();
              if ((localLayoutParams == null) || (!(localLayoutParams.a)))
              {
                float f1 = paramInt1;
                localView.measure(View.MeasureSpec.makeMeasureSpec((int)(localLayoutParams.c * f1), 1073741824), this.u);
              }
            }
            paramInt2 += 1;
          }
          return;
        }
        label522: i1 = paramInt1;
      }
      label528: i6 = i1;
    }
  }

  protected boolean onRequestFocusInDescendants(int paramInt, Rect paramRect)
  {
    int i1;
    int i3 = -1;
    int i2 = getChildCount();
    if ((paramInt & 0x2) != 0)
    {
      i3 = 1;
      i1 = 0;
    }
    while (i1 != i2)
    {
      View localView = getChildAt(i1);
      if (localView.getVisibility() == 0)
      {
        aw localaw = a(localView);
        if ((localaw != null) && (localaw.b == this.h) && (localView.requestFocus(paramInt, paramRect)))
        {
          return true;
          i1 = i2 - 1;
          i2 = -1;
        }
      }
      i1 += i3;
    }
    return false;
  }

  public void onRestoreInstanceState(Parcelable paramParcelable)
  {
    if (!(paramParcelable instanceof SavedState))
    {
      super.onRestoreInstanceState(paramParcelable);
      return;
    }
    paramParcelable = (SavedState)paramParcelable;
    super.onRestoreInstanceState(paramParcelable.getSuperState());
    if (this.g != null)
    {
      Object localObject = paramParcelable.b;
      localObject = paramParcelable.c;
      a(paramParcelable.a, false, true);
      return;
    }
    this.i = paramParcelable.a;
    this.j = paramParcelable.b;
    this.k = paramParcelable.c;
  }

  public Parcelable onSaveInstanceState()
  {
    SavedState localSavedState = new SavedState(super.onSaveInstanceState());
    localSavedState.a = this.h;
    if (this.g != null)
      localSavedState.b = null;
    return localSavedState;
  }

  protected void onSizeChanged(int paramInt1, int paramInt2, int paramInt3, int paramInt4)
  {
    float f1;
    super.onSizeChanged(paramInt1, paramInt2, paramInt3, paramInt4);
    if (paramInt1 != paramInt3)
    {
      paramInt2 = this.n;
      paramInt4 = this.n;
      if ((paramInt3 <= 0) || (this.d.isEmpty()))
        break label131;
      f1 = getScrollX() / (paramInt4 + paramInt3);
      paramInt2 = (int)((paramInt2 + paramInt1) * f1);
      scrollTo(paramInt2, getScrollY());
      if (!(this.l.isFinished()))
      {
        paramInt3 = this.l.getDuration();
        paramInt4 = this.l.timePassed();
        localaw = e(this.h);
        this.l.startScroll(paramInt2, 0, (int)(localaw.e * paramInt1), 0, paramInt3 - paramInt4);
      }
    }
    return;
    label131: aw localaw = e(this.h);
    if (localaw != null)
      f1 = Math.min(localaw.e, this.s);
    while (true)
    {
      do
        paramInt1 = (int)(f1 * paramInt1);
      while (paramInt1 == getScrollX());
      a(false);
      scrollTo(paramInt1, getScrollY());
      return;
      f1 = 0.0F;
    }
  }

  public boolean onTouchEvent(MotionEvent paramMotionEvent)
  {
    label364: int i4;
    int i5 = 0;
    if (this.O)
      return true;
    if ((paramMotionEvent.getAction() == 0) && (paramMotionEvent.getEdgeFlags() != 0))
      return false;
    if ((this.g == null) || (this.g.a() == 0))
      return false;
    if (this.J == null)
      this.J = VelocityTracker.obtain();
    this.J.addMovement(paramMotionEvent);
    int i1 = i5;
    switch (paramMotionEvent.getAction() & 0xFF)
    {
    default:
    case 4:
    case 0:
    case 2:
    case 1:
    case 3:
    case 5:
    case 6:
    }
    for (i1 = i5; ; i4 = i5)
    {
      while (true)
      {
        if (i1 != 0)
          ag.b(this);
        return true;
        this.l.abortAnimation();
        this.x = false;
        d();
        this.z = true;
        b(1);
        float f1 = paramMotionEvent.getX();
        this.G = f1;
        this.E = f1;
        f1 = paramMotionEvent.getY();
        this.H = f1;
        this.F = f1;
        this.I = r.b(paramMotionEvent, 0);
        i1 = i5;
        continue;
        if (!(this.z))
        {
          i1 = r.a(paramMotionEvent, this.I);
          f1 = r.c(paramMotionEvent, i1);
          float f3 = Math.abs(f1 - this.E);
          f2 = r.d(paramMotionEvent, i1);
          float f4 = Math.abs(f2 - this.F);
          if ((f3 > this.D) && (f3 > f4))
          {
            this.z = true;
            if (f1 - this.G <= 0.0F)
              break label364;
            f1 = this.G + this.D;
          }
        }
        while (true)
        {
          while (true)
          {
            do
            {
              this.E = f1;
              this.F = f2;
              b(1);
              b(true);
              i1 = i5;
            }
            while (!(this.z));
            bool1 = a(r.c(paramMotionEvent, r.a(paramMotionEvent, this.I))) | false;
          }
          f1 = this.G - this.D;
        }
        boolean bool1 = i5;
        if (!(this.z))
          continue;
        Object localObject = this.J;
        ((VelocityTracker)localObject).computeCurrentVelocity(1000, this.L);
        int i6 = (int)ac.a((VelocityTracker)localObject, this.I);
        this.x = true;
        i5 = getWidth();
        int i7 = getScrollX();
        localObject = g();
        int i2 = ((aw)localObject).b;
        float f2 = (i7 / i5 - ((aw)localObject).e) / ((aw)localObject).d;
        if ((Math.abs((int)(r.c(paramMotionEvent, r.a(paramMotionEvent, this.I)) - this.G)) > this.M) && (Math.abs(i6) > this.K))
        {
          if (i6 > 0);
          while (true)
          {
            boolean bool2;
            while (true)
            {
              i5 = i2;
              if (this.d.size() > 0)
              {
                paramMotionEvent = (aw)this.d.get(0);
                localObject = (aw)this.d.get(this.d.size() - 1);
                i5 = Math.max(paramMotionEvent.b, Math.min(i2, ((aw)localObject).b));
              }
              a(i5, true, true, i6);
              this.I = -1;
              h();
              bool2 = this.P.c() | this.Q.c();
            }
            bool2 += true;
          }
        }
        if (i3 >= this.h)
          f1 = 0.4F;
        while (true)
        {
          while (true)
            i3 = (int)(i3 + f2 + f1);
          f1 = 0.6F;
        }
        int i3 = i5;
        if (!(this.z))
          continue;
        a(this.h, true, 0, false);
        this.I = -1;
        h();
        boolean bool3 = this.P.c() | this.Q.c();
        continue;
        i4 = r.a(paramMotionEvent);
        this.E = r.c(paramMotionEvent, i4);
        this.I = r.b(paramMotionEvent, i4);
        i4 = i5;
      }
      a(paramMotionEvent);
      this.E = r.c(paramMotionEvent, r.a(paramMotionEvent, this.I));
    }
  }

  public void removeView(View paramView)
  {
    if (this.v)
    {
      removeViewInLayout(paramView);
      return;
    }
    super.removeView(paramView);
  }

  protected boolean verifyDrawable(Drawable paramDrawable)
  {
    return ((!(super.verifyDrawable(paramDrawable))) && (paramDrawable != this.o));
  }
}